(function(vc,vm){

    vc.extends({
        data:{
            editGovActivityReplyInfo:{
                replyId:'',
replyId:'',
actId:'',
parentReplyId:'',
context:'',
userId:'',
userName:'',
preUserName:'',
sessionId:'',
preAuthorId:'',
statusCd:'',

            }
        },
         _initMethod:function(){

         },
         _initEvent:function(){
             vc.on('editGovActivityReply','openEditGovActivityReplyModal',function(_params){
                vc.component.refreshEditGovActivityReplyInfo();
                $('#editGovActivityReplyModel').modal('show');
                vc.copyObject(_params, vc.component.editGovActivityReplyInfo );
                vc.component.editGovActivityReplyInfo.caId = vc.getCurrentCommunity().caId;
            });
        },
        methods:{
            editGovActivityReplyValidate:function(){
                        return vc.validate.validate({
                            editGovActivityReplyInfo:vc.component.editGovActivityReplyInfo
                        },{
                            'editGovActivityReplyInfo.replyId':[
{
                            limit:"required",
                            param:"",
                            errInfo:"回复ID不能为空"
                        },
 {
                            limit:"maxLength",
                            param:"30",
                            errInfo:"回复ID不能超过30"
                        },
                    ],
'editGovActivityReplyInfo.actId':[
{
                            limit:"required",
                            param:"",
                            errInfo:"活动ID不能为空"
                        },
 {
                            limit:"maxLength",
                            param:"30",
                            errInfo:"活动ID不能超过30"
                        },
                    ],
'editGovActivityReplyInfo.parentReplyId':[
{
                            limit:"required",
                            param:"",
                            errInfo:"上级回复ID不能为空"
                        },
 {
                            limit:"maxLength",
                            param:"30",
                            errInfo:"上级回复ID不能超过30"
                        },
                    ],
'editGovActivityReplyInfo.context':[
{
                            limit:"required",
                            param:"",
                            errInfo:"回复内容不能为空"
                        },
 {
                            limit:"maxLength",
                            param:"长文本",
                            errInfo:"回复内容不能超过长文本"
                        },
                    ],
'editGovActivityReplyInfo.userId':[
{
                            limit:"required",
                            param:"",
                            errInfo:"作者不能为空"
                        },
 {
                            limit:"maxLength",
                            param:"30",
                            errInfo:"作者不能超过30"
                        },
                    ],
'editGovActivityReplyInfo.userName':[
{
                            limit:"required",
                            param:"",
                            errInfo:"作者不能为空"
                        },
 {
                            limit:"maxLength",
                            param:"64",
                            errInfo:"作者不能超过64"
                        },
                    ],
'editGovActivityReplyInfo.preUserName':[
{
                            limit:"required",
                            param:"",
                            errInfo:"上一级作者不能为空"
                        },
 {
                            limit:"maxLength",
                            param:"64",
                            errInfo:"上一级作者不能超过64"
                        },
                    ],
'editGovActivityReplyInfo.sessionId':[
{
                            limit:"required",
                            param:"",
                            errInfo:"一次会话ID不能为空"
                        },
 {
                            limit:"maxLength",
                            param:"30",
                            errInfo:"一次会话ID不能超过30"
                        },
                    ],
'editGovActivityReplyInfo.preAuthorId':[
{
                            limit:"required",
                            param:"",
                            errInfo:"回复作者ID不能为空"
                        },
 {
                            limit:"maxLength",
                            param:"30",
                            errInfo:"回复作者ID不能超过30"
                        },
                    ],
'editGovActivityReplyInfo.statusCd':[
{
                            limit:"required",
                            param:"",
                            errInfo:"数据状态不能为空"
                        },
 {
                            limit:"maxLength",
                            param:"2",
                            errInfo:"数据状态不能超过2"
                        },
                    ],
'editGovActivityReplyInfo.replyId':[
{
                            limit:"required",
                            param:"",
                            errInfo:"活动评论ID不能为空"
                        }]

                        });
             },
            editGovActivityReply:function(){
                if(!vc.component.editGovActivityReplyValidate()){
                    vc.toast(vc.validate.errInfo);
                    return ;
                }

                vc.http.apiPost(
                    '/govActivityReply/updateGovActivityReply',
                    JSON.stringify(vc.component.editGovActivityReplyInfo),
                    {
                        emulateJSON:true
                     },
                     function(json,res){
                        //vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
                        let _json = JSON.parse(json);
                        if (_json.code == 0) {
                            //关闭model
                            $('#editGovActivityReplyModel').modal('hide');
                             vc.emit('govActivityReplyManage','listGovActivityReply',{});
                            return ;
                        }
                        vc.message(_json.msg);
                     },
                     function(errInfo,error){
                        console.log('请求失败处理');

                        vc.message(errInfo);
                     });
            },
            refreshEditGovActivityReplyInfo:function(){
                vc.component.editGovActivityReplyInfo= {
                  replyId:'',
replyId:'',
actId:'',
parentReplyId:'',
context:'',
userId:'',
userName:'',
preUserName:'',
sessionId:'',
preAuthorId:'',
statusCd:'',

                }
            }
        }
    });

})(window.vc,window.vc.component);
